﻿using System.Windows;
using MyWpfApp.Controls;
using ViewModel.Finance;

namespace MyWpfApp.Finance
{
    /// <summary>
    /// Interaction logic for CategoryPropertiesView.xaml
    /// </summary>
    public partial class CategoryPropertiesView : BasePropertyWindow
    {
        private CategoryPropertiesViewModel viewModel;

        public CategoryPropertiesView()
        {
            InitializeComponent();
        }

        private void OKClicked(object sender, RoutedEventArgs e)
        {
            if (!viewModel.Save())
            {
                //something bad happend
                return;
            }
            DialogResult = true;

            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            viewModel = DataContext as CategoryPropertiesViewModel;
        }
    }
}
